home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F43426_testPartition.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  831 b   |  31 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:myIsEven="myIsEven"
  4. >
  5.  
  6.   <xsl:import href="partition.xsl"/>
  7.   
  8.   <!-- To be applied on numList.xml -->
  9.  
  10.   <xsl:output indent="yes" omit-xml-declaration="yes"/>
  11.   
  12.   <myIsEven:myIsEven/>
  13.   
  14.   <xsl:template match="/">
  15.     <xsl:variable name="vIsEven" select="document('')/*/myIsEven:*[1]"/>
  16.     
  17.     Partitioning by IsEven:
  18.     <xsl:call-template name="partition">
  19.         <xsl:with-param name="pList" select="/*/*"/>
  20.         <xsl:with-param name="pController" select="$vIsEven"/>
  21.     
  22.     </xsl:call-template>
  23.   
  24.   </xsl:template>
  25.   
  26.   <xsl:template name="myIsEven" match="*[namespace-uri()='myIsEven']">
  27.     <xsl:param name="arg1"/>
  28.     
  29.     <xsl:if test="$arg1 mod 2 = 0">1</xsl:if>
  30.   </xsl:template>
  31. </xsl:stylesheet>